import request from '@/utils/request'

// 查询设备配置列表
export function listEquipment(query) {
  return request({
    url: '/energy/equipment/list',
    method: 'get',
    params: query
  })
}

// 查询设备配置详细
export function getEquipment(id) {
  return request({
    url: '/energy/equipment/' + id,
    method: 'get'
  })
}

// 查询设备列表
export function deviceLists(queryClass) {
  return request({
    url: '/energy/equipment/deviceLists/' +queryClass,
    method: 'get'
  })
}

// 查询所有设备列表,查询全是数据
export function deviceListsAll() {
  return request({
    url: '/energy/equipment/deviceListsAll/',
    method: 'get'
  })
}

// 新增设备配置
export function addEquipment(data) {
  return request({
    url: '/energy/equipment',
    method: 'post',
    data: data
  })
}

// 修改设备配置
export function updateEquipment(data) {
  return request({
    url: '/energy/equipment',
    method: 'put',
    data: data
  })
}

// 删除设备配置
export function delEquipment(id) {
  return request({
    url: '/energy/equipment/' + id,
    method: 'delete'
  })
}

// 获取设备异常列表
export function deviceWaring() {
  return request({
    url: '/energy/equipment/deviceWaring' ,
    method: 'get'
  })
}

// 获取空调面板信息
export function acPanelInfoInfo() {
  return request({
    url: '/energy/equipment/acPanelInfoInfo' ,
    method: 'get'
  })
}
// 空调开关机
export function changePower(code) {
  return request({
    url: '/energy/equipment/changePower/'+code ,
    method: 'get'
  })
}
// 空调制冷热
export function  changeMode(code) {
  return request({
    url: '/energy/equipment/changeMode/'+code ,
    method: 'get'
  })
}

// 空调制冷热
export function  changeTem(code,value) {
  return request({
    url: '/energy/equipment/changeTem/'+code +'/'+value,
    method: 'get'
  })
}

// 空调风速
export function  changeWindSpeed(code,value) {
  return request({
    url: '/energy/equipment/changeWindSpeed/'+code+'/'+value,
    method: 'get'
  })
}
